<?php namespace Admin\Controller;

class WebSetController extends CommonController{
	private $model;
	public function __construct(){
		parent::__construct();
		$this->model = new \Admin\Model\Webset;
	}
	
	public function index(){
		if(IS_POST){
			foreach(Q('post.') as $name=>$value){
				$this->model->where("name='{$name}'")->save(array('value'=>$value));
			}
			$phpCode = var_export(Q('post.'),true);
			$str = <<<str
<?php
return {$phpCode};
str;
				
			file_put_contents("./Config/custom.php", $str);
		}
		$data = $this->model->get();
		View::with('data',$data);
		View::make();
	}
	
}






 ?>